package com.wicket.okrbff.web.contorller;

import com.wicket.okrbff.biz.service.FunctionalGoalService;
import com.wicket.okrbff.biz.service.dto.req.BffAddTargetDetailsReqDto;
import com.wicket.okrbff.biz.service.dto.req.BffQueryTargetDetailMgtListReqDto;
import com.wicket.okrbff.biz.service.dto.req.BffQueryTargetDetailsListReqDto;
import com.wicket.okrbff.biz.service.dto.req.BffUpdateTargetDetailReqDto;
import com.wicket.okrbff.biz.service.dto.res.BffAddTargetDetailsRespDto;
import com.wicket.okrbff.biz.service.dto.res.BffQueryTargetDetailMgtListRespDto;
import com.wicket.okrbff.biz.service.dto.res.BffQueryTargetDetailsListRespDto;
import com.wicket.okrbff.biz.service.dto.res.BffUpdateTargetDetailRespDto;
import com.wicket.okrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseFunctionalGoalClient;
import com.wicket.okrframework.integration.dto.AddTargetDetailsRespDto;
import com.wicket.okrframework.integration.dto.AddTargetDetailsReqDto;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.UpdateTargetDetailRespDto;
import com.wicket.okrframework.integration.dto.UpdateTargetDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryTargetDetailsListRespDto;
import com.wicket.okrframework.integration.dto.QueryTargetDetailsListReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffOrgDutyTargetDetailDto;
import cn.hutool.core.bean.BeanUtil;
import java.util.stream.Collectors;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "FunctionalGoal", tags = {"FunctionalGoal"})
@RestController
// @RequestMapping("/oms/functionalGoal/")
public class FunctionalGoalController {

    @Autowired
    FunctionalGoalService functionalGoalService;

    /**
   * B1-3新增目标职责明细（管理）
   * gen by moon at 8/10/2022, 3:30:54 AM
   */
    @PostMapping("/oms/mgt/functionalGoal/addTargetDetails")
    @ApiOperation(value = "B1-3新增目标职责明细（管理）", response = OkrResult.class)
    public OkrResult<BffAddTargetDetailsRespDto> addTargetDetails(@RequestBody(required=false) @Validated BffAddTargetDetailsReqDto reqDTO){
        return OkrResult.success(functionalGoalService.addTargetDetails(reqDTO));
    }

    /**
   * B1-3查询目标职责明细列表
   * gen by moon at 8/18/2022, 10:21:53 PM
   */
    @PostMapping("/oms/functionalGoal/queryTargetDetailsList")
    @ApiOperation(value = "B1-3查询目标职责明细列表", response = OkrResult.class)
    public OkrResult<BffQueryTargetDetailsListRespDto> queryTargetDetailsList(@RequestBody(required=false) @Validated BffQueryTargetDetailsListReqDto reqDTO){
        return OkrResult.success(functionalGoalService.queryTargetDetailsList(reqDTO));
    }

    /**
   * B1-3修改目标职责明细（管理）
   * gen by moon at 8/10/2022, 3:30:56 AM
   */
    @PostMapping("/oms/mgt/functionalGoal/updateTargetDetail")
    @ApiOperation(value = "B1-3修改目标职责明细（管理）", response = OkrResult.class)
    public OkrResult<BffUpdateTargetDetailRespDto> updateTargetDetail(@RequestBody(required=false) @Validated BffUpdateTargetDetailReqDto reqDTO){
        return OkrResult.success(functionalGoalService.updateTargetDetail(reqDTO));
    }

    /**
   * B1-3查询管理模式目标职责明细列表(管理)
   * gen by moon at 8/10/2022, 3:31:00 AM
   */
    @PostMapping("/oms/mgt/functionalGoal/queryTargetDetailMgtList")
    @ApiOperation(value = "B1-3查询管理模式目标职责明细列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryTargetDetailMgtListRespDto> queryTargetDetailMgtList(@RequestBody(required=false) @Validated BffQueryTargetDetailMgtListReqDto reqDTO){
        return OkrResult.success(functionalGoalService.queryTargetDetailMgtList(reqDTO));
    }
}
